import type { BaseTableConfig } from '@/components/base-ui/base-table/type';
import { generateRandomId, InputType } from '@/utils';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'equipmentNumber',
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '设备编码',
                width: 240
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            modelKey: 'deviceName',
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '设备名称',
                width: 240
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'deviceType',
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '设备类型',
                width: 240
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },

        {
            itemType: 'select',
            modelKey: 'equipmentStatus',
            elSelectProps: {
                options: [
                    { value: 'USING', label: '使用中' },
                    { value: 'IDLE', label: '空闲' },
                    { value: 'IDLE_SCRAP', label: '维修中' },
                    { value: 'SCRAP', label: '报废' }
                ]
            },
            columnProps: {
                label: '设备状态',
                width: 180
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'workshop',
            slotName: 'workshop',
            columnProps: {
                label: '所属车间',
                width: 180
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        }
    ],
    unAction: true
};
